home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / tcp / AmigaTCP.lha / AmigaTCP / src / udp.h < prev    next >
C/C++ Source or Header  |  1989-06-24  |  1KB  |  40 lines

  1. /* User Datagram Protocol definitions */
  2.  
  3. #define    NUDP    20
  4.  
  5. /* Structure of a UDP protocol header */
  6. struct udp_header {
  7.     int16 source;    /* Source port */
  8.     int16 dest;    /* Destination port */
  9.     int16 length;    /* Length of header and data */
  10.     int16 checksum;    /* Checksum over pseudo-header, header and data */
  11. };
  12.  
  13. /* User Datagram Protocol control block
  14.  * Each entry on the receive queue consists of the
  15.  * remote socket structure, followed by any data
  16.  */
  17. struct udp_cb {
  18.     struct udp_cb *prev;    /* Linked list pointers */
  19.     struct udp_cb *next;
  20.     struct socket socket;    /* Local port accepting datagrams */
  21.     void (*r_upcall)();    /* Function to call when one arrives */
  22.     struct mbuf *rcvq;    /* Queue of pending datagrams */
  23.     int rcvcnt;        /* Count of pending datagrams */
  24. };
  25. extern struct udp_cb *udps[];    /* Hash table for UDP structures */
  26. #define    NULLUDP    (struct udp_cb *)NULL
  27.  
  28. /* UDP statistics counters */
  29. struct udp_stat {
  30.     int16 rcvd;        /* Packets received */
  31.     int16 sent;        /* Packets sent */
  32.     int16 cksum;        /* Checksum errors */
  33.     int16 unknown;        /* Unknown socket */
  34.     int16 bdcsts;        /* Incoming broadcasts */
  35. };
  36.  
  37. /* UDP primitives */
  38. int open_udp(),recv_udp(),send_udp(),del_udp();
  39. void udp_dump();
  40.